	<div class="container">
	<div class="title">
		<div class="title_text">砍单词 WordsDestructor</div>
	</div>
	
	<div class="menu">
	<div id=registerblock>
		<h3>注册</h3>
		<form id=register method=post action=__APP__/User/register>
			<div id=uname>
				<label>用户名&nbsp&nbsp</label><input type=text name=username /><label class=hint></label>
			</div>
			<div id=pwd>
				<label>密码&nbsp&nbsp&nbsp&nbsp</label><input type=password name=pwd /><label class=hint></label>
			</div>
			<div id=pwd_re>
				<label>重复密码</label><input type=password /><label class=hint></label>
			</div>
			<div id=submit>
				<button>注册</button><label class=hint></label>
			</div>
		</form>
	</div>
	<div id=loginblock>
		<h3>登录</h3>
		<form id=login method=post action=__APP__/User/login>
			<div>
			<label>用户名&nbsp&nbsp</label><input type=text name=username />
			</div>
			<div>
			<label>密码&nbsp&nbsp&nbsp&nbsp</label><input type=password name=pwd />
			</div>
			<div>
			<input type=submit value=提交 />
			</div>
		</form>
	</div>
	</div>

	
<script type=text/javascript>


flag = true;
$("#uname input").blur(function(){
	if ($(this).val()=="") { $("#uname .hint").text("名字不能是空哦～"); flag=false; }
	else { $.get("{:U('Home-User/isUserExist/username/');}"+$(this).val(),function(str){
			if (str == '1') { $("#uname .hint").text("换个名字吧～"); flag=false; }
			else { $("#uname .hint").text("该用户名可以使用"); flag=true;}});}
});
$("#pwd input").blur(function(){
	if ($(this).val().length < 6) { $("#pwd .hint").text("密码长度至少要6位");flag=false;}
	else $("#pwd .hint").text("");
});
$("#pwd_re input").blur(function(){
	if ($(this).val() != $("#pwd input").val()) { $("#pwd_re .hint").text("两次密码应该相同"); flag=false;}
	else $("#pwd_re .hint").text("");
});
$("#register").submit(function(){
	$("#uname input").blur();
	$("#pwd input").blur();
	$("#pwd_re input"	).blur();
	if (!flag) {
		$("#submit .hint").text("信息不符合要求");
		return false;
	}
});
</script>

	<div id=dictionary class="main">
		<h3>查词</h3>
		<form id=lookup method=post action=__APP__/dictionary/lookUpWord />
			<input type=text name=searchContent id=searchContent /> <input id=dolookup type=submit value="Look up" />
		</form>
		<div id=result>
		</div>
	</div>
	
	<div class="clear"></div>
	
	<div class="info">
			<div class="info_text">
				All rights reserved.
			</div>
			
	</div>
	</div>
	
	
<script type=text/javascript>
	$("#dolookup").click(function(){
		form = $("#lookup").serialize();
		form = decodeURIComponent(form);
		$.post($("#lookup").attr("action"), form, function(str){
			$("#result").load("{:U('Dictionary/lookUpWord/searchContent/');}"+$("#searchContent").val());
		});
		return false;
	});
</script>
